package com.example.fengjl.ndkdemo.calc;
/*		
 * ============================================================================		
 * = COPYRIGHT		
 *               PAX TECHNOLOGY, Inc. PROPRIETARY INFORMATION		
 *   This software is supplied under the terms of a license agreement or		
 *   nondisclosure agreement with PAX  Technology, Inc. and may not be copied		
 *   or disclosed except in accordance with the terms in that agreement.		
 *      Copyright (C) 2017-? PAX Technology, Inc. All rights reserved.		
 * Description: 		
 *              		
 * Revision History:		
 * Date	                 Author	                Action
 * 20170428	             fengjl	                Create/Add/Modify/Delete
 * ============================================================================
 */

public class Calc {
    // Used to load the 'native-lib' library on application startup.
    static {
        System.loadLibrary("calc-lib");
    }

    public static int CALC_TYPE_ADD = 0;
    public static int CALC_TYPE_SUB = CALC_TYPE_ADD + 1;
    public static int CALC_TYPE_MUTL = CALC_TYPE_ADD + 2;
    public static int CALC_TYPE_DIDV = CALC_TYPE_ADD + 3;

    public static native float calcNative(int calcType, int param1, int param2);

    public static float calcAdd(int a, int b) {

        return calcNative(CALC_TYPE_ADD, a, b);

    }


    public static float calcSub(int a, int b) {

        return calcNative(CALC_TYPE_SUB, a, b);

    }

    public static float calcMult(int a, int b) {

        return calcNative(CALC_TYPE_MUTL, a, b);

    }

    public static float calcDivid(int a, int b) {

        return calcNative(CALC_TYPE_DIDV, a, b);

    }

}
